# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-gps
pkgname=('python2-gps' 'python-gps')
_pkgname=gps
pkgver=3.19
pkgrel=7
pkgdesc='GPSD client.'
arch=('any')
url='https://pypi.org/project/gps/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('1a18298e4f41928f2dfe77f6d85cfd3c4959de1b4954f4897e698efd19dc1d329492f762c2461145d791098d92c7ae27bbb7d9fe862309197b59b60aa9d25379')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-gps() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-gps() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

